package baiqitun.stupro.security.entity;

import baiqitun.stupro.common.constant.SysConstant;
import baiqitun.stupro.common.entity.Entity;
import baiqitun.stupro.common.entity.TreeNode;
import baiqitun.stupro.common.validate.group.SaveGroup;
import baiqitun.stupro.common.validate.group.SaveRootGroup;
import baiqitun.stupro.common.validate.group.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author kedaji
 * @since 2020-03-25
 */
@ApiModel("部门")
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("stupro_depart")
public class SysDepart extends TreeNode {

    private static final long serialVersionUID=1L;

    @NotBlank(message = "父部门id不能为空", groups = {SaveGroup.class})
    @Null(message = SysConstant.ER_PARAMETER_MUST_NULL, groups = {SaveRootGroup.class})
    @ApiModelProperty("父部门id")
    private String parentId;


    @NotBlank(message = "部门名称不能为空", groups = {SaveRootGroup.class, SaveGroup.class, UpdateGroup.class})
    @ApiModelProperty("部门名称")
    private String name;
}
